package com.amoyt.project.domain.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 * 意见反馈表（评论表）
 * </p>
 *
 * @author AmoyT
 * @since 2025-08-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(description = "意见反馈表（评论表）")
@TableName("opinion_feedback")
public class Feedback implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "自增主键ID")
    @TableId(value = "back_id", type = IdType.AUTO)
    private Long backId;

    @Schema(description = "关联用户ID（与普通用户对应）")
    private String userId;

    @Schema(description = "用户名称")
    private String userName;

    @Schema(description = "用户头像")
    private String userAvatar;

    @Schema(description = "默认为空，代表仅仅是反馈（比如投诉渠道），与公告无关")
    private String announcementId;

    @Schema(description = "是否匿名：0-非匿名，1-匿名")
    private String isAnonymous;

    @Schema(description = "意见反馈用途：1-选举，2-意见征集，3-投诉，可扩展其他用途")
    private String feedbackPurpose;

    @Schema(description = "个人意见详情（如投诉对象、支持理由等，支持长文本）")
    private String personalOpinion;

    @Schema(description = "意见选择：1-支持，2-不支持/投诉，3-保持中立")
    private String opinionChoice;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    @Schema(description = "创建人（记录用户名或用户ID）")
    private String createBy;

    @Schema(description = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;

    @Schema(description = "更新人（记录用户名或用户ID）")
    private String updateBy;

    @Schema(description = "逻辑删除：0-未删除，1-已删除")
    private Integer deleted;

    @Schema(description = "处理结果：0-未处理，1-处理完成")
    private Integer isHandle;

    @Schema(description = "处理详情")
    private String handleDetail;
}
